// 传统写法示例 - 路由配置

import { createRouter, createWebHashHistory } from "vue-router";

// 传统写法：在文件顶部直接导入所有组件
import Home from "@/views/home/index.vue";
import Message from "@/views/message/index.vue";
import MyVideo from "@/views/myVideo/index.vue";
import Mine from "@/views/mine/index.vue";
import Order from "@/components/Order.vue";
import OrderStatus from "@/components/OrderStatus.vue";
import Details from "@/components/Details.vue";

// 路由配置
const routes = [
    {
        // 首页
        path: "/",
        name: "home",
        meta: { isTab: true },
        component: Home,  // 直接使用已导入的组件
    }, {
        path: "/message",
        name: "message",
        meta: { isTab: true },
        component: Message  // 直接使用已导入的组件
    }, {
        path: "/myVideo",
        name: "myVideo",
        meta: { isTab: true },
        component: MyVideo  // 直接使用已导入的组件
    }, {
        path: "/mine",
        name: "mine",
        meta: { isTab: true },
        component: Mine  // 直接使用已导入的组件
    }, {
        path: "/order",
        name: "order",
        meta: { isTab: true },
        component: Order  // 直接使用已导入的组件
    }, {
        // 订单详情
        path: "/orderStatus/:id",
        name: "orderStatus",
        meta: { isTab: true },
        component: OrderStatus  // 直接使用已导入的组件
    }, {
        // 商品详情
        path: "/details",
        name: "details",
        meta: { isTab: true },
        component: Details  // 直接使用已导入的组件
    }
];

const router = createRouter({
    history: createWebHashHistory(),
    routes
});

export default router;